package org.akomantoso.core.data;

import java.io.IOException;

import org.akomantoso.core.data.group.ANhier;
import org.akomantoso.core.io.Output;
import org.akomantoso.core.visitor.AKVisitor;

/**
 * This element is a hierarchical container called "subsection" either explicitly or due to the local tradition.
 * 
 * <pre>
 * 	<xsd:element name="" type="hierarchy"/>
 * </pre>
 *
 */
public final class SubSection extends Hierarchy implements ANhier {

	public static final String ELEMENT = "subsection";

	/**
	 * @see org.akomantoso.core.data.Hierarchy#writeExternal(org.akomantoso.core.io.Output)
	 */
	@Override
	public <T extends Output> void writeExternal(T out) throws IOException {
		out.writeStart(ELEMENT);
		super.writeExternal(out);
		out.writeEnd();
	}
	
	/**
	 * @see ec.ep.visitor.AKVisitable#accept(ec.ep.visitor.AKVisitor)
	 */
	public void accept(AKVisitor visitor) {
		if (visitor.visitBegin(this)) {
			internalAccept(visitor);
			visitor.visitEnd(this);
		}
	}
}
